<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Logger
 *
 * @author zelic
 */
class Logger {
    static $persistence = null;
    
    public static function init(){
        Logger::$persistence = fopen("../log/system.log", "a");
    }
    
    public static function error($message){
        date_default_timezone_set("Asia/Ho_Chi_Minh");
        $time = date("d/m/Y H:i:s",time());
        fwrite(Logger::$persistence, "[ERROR - $time] - $message\n");
    }
    
    public static function info($message){
        date_default_timezone_set("Asia/Ho_Chi_Minh");
        $time = date("d/m/Y H:i:s",time());
        fwrite(Logger::$persistence, "[INFO - $time] - $message\n");
    }
    
    public static function debug($message){
        date_default_timezone_set("Asia/Ho_Chi_Minh");
        $time = date("d/m/Y H:i:s",time());
        fwrite(Logger::$persistence, "[INFO - $time] - $message\n");
    }
    
    public static function finish(){
        fclose(Logger::$persistence);
    }
    
    
}

?>
